/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.basics.bean.image;

import com.genia.toolbox.basics.bean.DataContainer;
import com.genia.toolbox.basics.exception.technical.TechnicalException;

/**
 * an {@link DataContainer} that represents an image.
 */
public interface ImageDataContainer
    extends DataContainer
{

  /**
   * returns a new {@link ImageDataContainer} containing the content of the
   * current {@link ImageDataContainer} with a surimposed text.
   * 
   * @param addTextTransformation
   *          the parameters of the surimposed text.
   * @return a new {@link ImageDataContainer} containing the content of the
   *         current {@link ImageDataContainer} with a surimposed text
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer addText(AddTextTransformation addTextTransformation)
      throws TechnicalException;
  
  /**
   * returns a new {@link ImageDataContainer} containing the image copied on top.
   * 
   * @param image
   *          the parameters of the surimposed image.
   * @param point
   *          the coords where to copy image on top.
   * @return a new {@link ImageDataContainer} containing the content of the
   *         current {@link ImageDataContainer} with a surimposed image
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer copyImage(ImageDataContainer image, Point point)
      throws TechnicalException;



  /**
   * returns the height of the image in pixel.
   * 
   * @return the height of the image in pixel
   */
  public int getHeight();



  /**
   * returns the width of the image in pixel.
   * 
   * @return the width of the image in pixel
   */
  public int getWidth();



  /**
   * retruns a new {@link ImageDataContainer} being the current
   * {@link ImageDataContainer} resized to the given parameters.
   * 
   * @param width
   *          the width of the new image
   * @param height
   *          the height of the new image
   * @return a new {@link ImageDataContainer} begin the current
   *         {@link ImageDataContainer} resized to the given parameters
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer resize(int width, int height)
      throws TechnicalException;



  /**
   * retruns a new {@link ImageDataContainer} being the current
   * {@link ImageDataContainer} resized proportionnaly so that the height of the
   * image is the one given in parameter.
   * 
   * @param height
   *          the height of the new image
   * @return a new {@link ImageDataContainer} being the current
   *         {@link ImageDataContainer} resized proportionnaly so that the
   *         height of the image is the one given in parameter
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer resizeByHeight(int height)
      throws TechnicalException;



  /**
   * retruns a new {@link ImageDataContainer} being the current
   * {@link ImageDataContainer} resized proportionnaly so that the width of the
   * image is the one given in parameter.
   * 
   * @param width
   *          the width of the new image
   * @return a new {@link ImageDataContainer} being the current
   *         {@link ImageDataContainer} resized proportionnaly so that the width
   *         of the image is the one given in parameter
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer resizeByWidth(int width)
      throws TechnicalException;



  /**
   * returns a new {@link ImageDataContainer} being the current
   * {@link ImageDataContainer} resized so proportionnaly to fit in the box size
   * given in parameters.
   * 
   * @param width
   *          the maximal width of the new image
   * @param height
   *          the maximal height of the new image
   * @return a new {@link ImageDataContainer} being the current
   *         {@link ImageDataContainer} resized so proportionnaly to fit in the
   *         box size given in parameters
   * @throws TechnicalException
   *           when an error occured
   */
  public ImageDataContainer resizeInBox(int width, int height)
      throws TechnicalException;



  /**
   * setter for the contentType property. the content type must be of type
   * "image/?" or an exception will be thrown.
   * 
   * @param contentType
   *          the contentType to set
   * @throws TechnicalException
   *           when an error occured
   */
  public void setContentType(String contentType)
      throws TechnicalException;
}
